<?php

$pid = empty($_GET['pid']) ? 0 : intval($_GET['pid']);
$id = empty($_GET['id']) ? 0 : intval($_GET['id']);

$oNewscat = new Newscat();

if($id > 0){
	
	$category_info = $oNewscat->get_row($id, 'id,pid,name,mark,rank,memo');
	$category_info['category_tree'] = $oNewscat->get_category_tree_ul(0, '', $id); // 取分类树
	
}else{
	
	$category_info = array('pid' => $pid, 'rank' => 100);
	$category_info['category_tree'] = $oNewscat->get_category_tree_ul($pid); // 取分类树
	
}

if($category_info['pid'] > 0){
	$parent_category = $oNewscat->get_row($category_info['pid'], 'id,name');
	$category_info['parent_name'] = $parent_category['name'];
}else{
	$category_info['parent_name'] = $__l['root'];
}

$vars['info'] = $category_info;

?>